<template>
  <div>
    <form-view ref="formView" :formId="formId" :dataId="dataId"
               @saveCallback="saveCallback" :disabled="disabled"
    ></form-view>

    <a-button key="submit" type="primary"  @click="saveForm">
      提交
    </a-button>
  </div>
</template>

<script>
  import {METHOD, removeAuthorization, request} from '@/utils/request'
  import {postAction, putAction} from '@/api/manage'
  import {getBpmForm,getBpmFormData} from '@/api/api'
  import FormView from "@/components/form/FormView";

  export default {
        name: 'FormDataEdit',
        components: {
          FormView
        },
        data () {
            return {
              formId:"",
              dataId:"",
              disabled:false
            }
        },
        created () {
          this.initForm();
        },
        methods: {
          initForm(){
            const formId=this.$route.query.formId;
            const dataId=this.$route.query.dataId;
            this.formId=formId
            this.dataId=dataId
            //修改表单不可编辑
            //this.disabled=true;
            console.log(formId)
            console.log(dataId)
          },
          saveForm() {
            this.$refs.formView.saveForm();
          },
          saveCallback(formData){
            console.log(formData)
            this.$message.success("保存成功！");
          },
          click1(){

          }
        },
    }
</script>